

package com.hazelcast.internal.memory.impl;

import com.hazelcast.internal.memory.ByteAccessStrategy;

import java.nio.ByteBuffer;

public final class ByteBufferAccessStrategy implements ByteAccessStrategy<ByteBuffer> {

    public static final ByteBufferAccessStrategy INSTANCE = new ByteBufferAccessStrategy();

    private ByteBufferAccessStrategy() {
    }

    @Override
    public byte getByte(ByteBuffer resource, long offset) {
        return resource.get((int) offset);
    }

    @Override
    public void putByte(ByteBuffer resource, long offset, byte value) {
        resource.put((int) offset, value);
    }
}
